package com.demo;

public class Demo04 {
    public static void main(String[] args) {
//        method1();
        System.out.println(getSum(100));
    }

    public static void method1() {
        System.out.println("123456789");
        method1();
    }

    public static int getSum(int n) {
        if (n == 1) {
            return 1;
        }
        return n + getSum(n - 1);
    }
}
